import 'dart:math';

import 'package:flutter_uxin/Tools/config/commonTool.dart';

class users_list {
  List<UsersProfile> usersProfile;

  users_list({this.usersProfile});

  users_list.fromJson(Map<String, dynamic> json) {
    if (json['users_profile'] != null) {
      usersProfile = new List<UsersProfile>();
      json['users_profile'].forEach((v) {
        usersProfile.add(new UsersProfile.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.usersProfile != null) {
      data['users_profile'] = this.usersProfile.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class UsersProfile {
  String areaId;
  String name;
  String sign;
  String mobile;
  String sex;
  int userType;
  String gradeId;
  String schoolId;
  String classId;
  bool flagOfUpdating;
  String headerImageUrl;
  String post;
  String realName;
  String id;
  String subject;

  UsersProfile(
      {this.areaId,
        this.name,
        this.sign,
        this.mobile,
        this.sex,
        this.userType,
        this.gradeId,
        this.schoolId,
        this.classId,
        this.flagOfUpdating,
        this.headerImageUrl,
        this.post,
        this.realName,
        this.id,
        this.subject});

  UsersProfile.fromJson(Map<String, dynamic> json) {
    areaId = json['area_id'];
    name = json['name'];
    sign = json['sign'];
    mobile = json['mobile'];
    sex = json['sex'];
    userType = json['user_type'];
    gradeId = json['grade_id'];
    schoolId = json['school_id'];
    classId = json['class_id'];

    flagOfUpdating = commonTool.changeValueToBool(json['flag_of_updating']);

    headerImageUrl = json['header_image_url'];
    post = json['post'];
    realName = json['real_name'];
    id = json['id'];
    subject = json['subject'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['area_id'] = this.areaId;
    data['name'] = this.name;
    data['sign'] = this.sign;
    data['mobile'] = this.mobile;
    data['sex'] = this.sex;
    data['user_type'] = this.userType;
    data['grade_id'] = this.gradeId;
    data['school_id'] = this.schoolId;
    data['class_id'] = this.classId;
    data['flag_of_updating'] = this.flagOfUpdating;
    data['header_image_url'] = this.headerImageUrl;
    data['post'] = this.post;
    data['real_name'] = this.realName;
    data['id'] = this.id;
    data['subject'] = this.subject;
    return data;
  }
}

